import { createApp } from 'vue';
import { createPinia } from 'pinia';
import App from './App.vue';
import router from './router';
import store from './store';
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';
// 导入图标库
import * as Icons from "@ant-design/icons-vue";

// Formily 组件
import { 
  Input,
  Password,
  InputNumber,
  Select,
  TreeSelect,
  Cascader,
  DatePicker,
  TimePicker,
  Checkbox,
  Radio,
  Upload,
  FormGrid,
  Space,
  ArrayTable,
  ArrayCards,
  FormItem
} from '@formily/antdv-x3';

const app = createApp(App);
const pinia = createPinia();

// 开始使用全局图标
const icons: any = Icons;
for (const i in icons) {
    // 循环注册组件
    app.component(i, icons[i]);
}

// 注册所有 Formily 组件
app.component('Input', Input);
app.component('Password', Password);
app.component('InputNumber', InputNumber);
app.component('Select', Select);
app.component('TreeSelect', TreeSelect);
app.component('Cascader', Cascader);
app.component('DatePicker', DatePicker);
app.component('TimePicker', TimePicker);
app.component('Checkbox', Checkbox);
app.component('Radio', Radio);
app.component('Upload', Upload);
app.component('FormGrid', FormGrid);
app.component('Space', Space);
app.component('ArrayTable', ArrayTable);
app.component('ArrayCards', ArrayCards);
app.component('FormItem', FormItem);

app.use(router);
app.use(store);
app.use(Antd);
app.use(pinia);
app.mount('#app');



